import axios from "@/api/config"

//审计日志开始========
export const audit = {
    getlist: data => axios.post('/log/management/log/record/sj/page', data),//获取审计日志列表
    detail: async (data) => { //日志详情
        const url = '/log/management/log/record/'+data;
        let res = await axios.get(url);
        return res;
    },
    export: function(data) {
        return axios({ // 用axios发送post请求
            method: 'post',
            url: '/log/management/log/record/sj/export', // 请求地址
            data: data, // 参数
            responseType: 'blob', // 表明返回服务器返回的数据类型
            headers: {
                'Content-Type': 'application/xls'
            }
        })
    }
}

//审计日志结束========

//业务日志开始=========
export const business = {
    getlist: data => axios.post('/log/management/log/record/bus/page', data),//获取业务日志列表
    detail: async (data) => { //业务日志详情
        const url = '/log/management/log/record/'+data;
        let res = await axios.get(url);
        return res;
    }
}
//业务日志结束=========

//登录日志开始=========
export const login = {
    getlist: data => axios.post('/log/management/log/time/page', data),//获取登录日志列表
    detail: async (data) => { //登录日志详情
        const url = '/log/management/log/time/'+data;
        let res = await axios.get(url);
        return res;
    }
}
//登录日志结束=========

//登录异常日志开始=========
export const loginErr = {
    getlist: data => axios.post('/log/management/log/error/page', data),//获取登录异常日志列表
    detail: async (data) => { //登录异常日志详情
        const url = '/log/management/log/error/'+data;
        let res = await axios.get(url);
        return res;
    }
}
//登录异常日志结束=========